package lion.dev.web.paging;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author lion
 * @date 2011-5-3
 *
 */
public class PagedVo<T> {

	private Paging paging;
	private List<T> vos = new ArrayList<>();
	private Map<String, Object> voMap = new HashMap<>();

	public PagedVo(int count) {

		this.paging = new LimitedPaging(count);
	}

	public PagedVo() {

		this.paging = new UnlimitedPaging();
	}

	public Paging getPaging() {

		return paging;
	}

	public List<T> getVos() {

		return vos;
	}

	public void setVos(List<T> vos) {

		this.vos = vos;
	}

	public Map<String, Object> getVoMap() {

		return voMap;
	}

	public void put(String key, Object value) {

		voMap.put(key, value);
	}

	@SuppressWarnings("unchecked")
	public <E> E get(String key) {

		return (E) voMap.get(key);
	}
}
